<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>土豆网鼠标经过显示遮罩</title>
    <style>
        .tudou{
            position: relative;
            width: 444px;
            height: 320px;
            background-color: pink;
            margin: 30px auto;
        }
        /* 图片与盒子一样大 */
        .tudou img{
            width: 100%;
            height: 100%;
        }
        .tudou::before{
            /* 隐藏遮罩层 */
            content: '';
            /* 先隐藏遮罩层 */
            display: none;
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.4) url(images/arr.png) no-repeat center;
        }
        /* 鼠标经过土豆这个盒子，就让里面的遮罩层显示出来 */
        .tudou:hover::before{
            display: block;
        }
    </style>
</head>
<body>
    <div class="tudou">
        <div class="mask"></div>
        <img src="images/tudou.jpg" alt="">   
    </div>
</body>
</html>